﻿namespace JxcLite.Services;

[WebApi, Service]
class ReportService(Context context) : ServiceBase(context), IReportService
{
    public Task<PagingResult<BillDetailInfo>> QueryBillDetailsAsync(PagingCriteria criteria)
    {
        if (criteria.OrderBys == null || criteria.OrderBys.Length == 0)
            criteria.OrderBys = [$"{nameof(BillDetailInfo.BillDate)}"];

        return ReportRepository.QueryBillDetailsAsync(Database, criteria);
    }

    public Task<PagingResult<ProfitInfo>> QueryProfitsAsync(PagingCriteria criteria)
    {
        return ReportRepository.QueryProfitsAsync(Database, criteria);
    }
}